﻿using System;
using System.ComponentModel;

// 版权所有：2014  All Rights Reserved.
// 文 件 名：ModelBase.cs
// 功能描述：
// 创建标识：m.sh.lin0328@163.com 2014/12/15 21:00:29
// 修改描述：
//----------------------------------------------------------------*/
namespace MslDiary.Framework
{
    /// <summary>
    /// 实现INotifyPropertyChanged的基类
    /// </summary>
    public class ViewModelBase : INotifyPropertyChanged
    {
        /*
        //使用方法： NotifyPropertyChange(() => Content);
        public event PropertyChangedEventHandler PropertyChanged;
        protected void NotifyPropertyChange<T>(Expression<Func<T>> expression)
        {
            if (PropertyChanged != null)
            {
                var propertyName = ((MemberExpression)expression.Body).Member.Name;
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }*/
        public bool IsInDesignMode;
        public event PropertyChangedEventHandler PropertyChanged;

        public void RaisePropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
